package prototype.ex2;

public class Client {

    public static void main(String[] args) {
        //创建原型对象
        Level proto = new Level();
        proto.setName("猴王出世");
        proto.setDescription("让猴王成功出世，可以通关本关卡");
        Monster[] monsters = {
                new Monster("小猴子", 100, 1),
                new Monster("大狮子", 200, 100),
        };
        proto.setMonsters(monsters);
        proto.setRewards(new Rewards(50));
        //克隆
        Level clone = proto.deepClone();
        //比较克隆结果
        System.out.println(clone == proto);
        System.out.println(clone.getRewards() == proto.getRewards());
        System.out.println(clone.getMonsters()[0] == proto.getMonsters()[0]);
    }
}
